<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>helloworld</title>
    <script type="text/javascript" src="../assets/js/vue-2.3.0.js"></script>
    <style>
        .aaa{font-size: 18px;color: #ff0033;}
        .bbb{text-shadow: 5px 5px 1px #ffc107;}
        .ccc{color: #333;}
        .isbol{color: green;}
    </style>
</head>
<body>
    <h1>v-bind</h1>
    <hr>
    <div id="app">
        <img style="width: 150px" :src="imgsrc" alt="">
        <a :href="url">知乎</a>
        <h4>绑定class</h4>
        <div :class="classA">1、class</div>
        <div :class="[classA,classB]">2、class中数组</div>
        <div :class="{isbol:isok}">3、class中数组</div>
        <div :class="isok?classA:classC">4、class三元表达式</div>
        <div :style="{fontSize:font}">绑定style</div>
        <div :style="styleObj">对象绑定style</div>

    </div>
</body>
<script type="text/javascript">
    var app = new Vue({
        el:'#app',
        data:{
            message: "helloworld!",
            imgsrc:"../assets/images/shareImg.png",
            url:'http://www.zhihu.com',
            classA:'aaa',
            classB:'bbb',
            classC:'ccc',
            isok:true,
            font:'22px',
            styleObj:{
                fontSize:'18px',
                color:'orange'
            }
        }
    })
</script>
</html>